<template>
  <div class="page has-navbar" v-nav="{title: '员工管理', showBackButton: true,onBackButtonClick: back,showMenuButton: true,menuButtonText:'新增', onMenuButtonClick: addStaff}">
    <div class="page-content padding-top">
         <item class="item-icon-right" v-for="item in staffList" @click.native="$router.forward('/staff/'+item.userId)">{{item.userName}}<i class="icon ion-ios-arrow-right" style="color: #DDD;"></i></item>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      staffList:[],
    }
  },
  created(){
    var _this = this;
    axios.get(baseUrl+'/controller/getUserList',{params:{
        marketId:sess.get('userSession').marketId,
        shopId:sess.get('userSession').shopId
      }
    })
    .then(function(res){
      _this.staffList = res.data.result
    })
  },
  methods:{
    addStaff() {
      $router.forward('/addStaff')
    },
    back(){
      $router.back('/desk')
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
